package com.example.happiness.controller.user;

import com.example.happiness.pojo.Category;
import com.example.happiness.result.Result;
import com.example.happiness.service.user.UserCategoryService;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Api(tags = "服务类型接口")
@Slf4j
@RestController
@RequestMapping("/user/category")
public class UserCategoryController {

    @Autowired
    UserCategoryService userCategoryService;

    @GetMapping("/getAllCategory")
    public Result<List<Category>> getAllCategory() {
        List<Category> categoryList = userCategoryService.getAllCategory();
        return Result.success(categoryList);
    }
}
